package cn.zf233.xcloud.service;

import cn.zf233.xcloud.commom.R;
import cn.zf233.xcloud.vo.AbsolutePath;
import cn.zf233.xcloud.entity.File;
import cn.zf233.xcloud.entity.User;
import cn.zf233.xcloud.vo.FileVo;

import java.io.IOException;
import java.util.List;

/**
 * Created by zf233 on 2020/11/4
 */
public interface FileService {

    R<List<FileVo>> list(User user, Long parentId, Integer sortFlag, Integer sortType);

    R<List<FileVo>> search(User user, String matchCode);

    R<List<FileVo>> listRecycle(User user);

    R<List<FileVo>> classify(User user, Integer classifyType);

    R save(User user, List<File> files, Long parentId) throws IOException;

    R download(User user, Long fileId);

    R rename(User user, Long fileId, String newFileName);

    R recycle(Long[] fileId, User user);

    R restore(Long[] fileId, User user);

    R flushRecycle(User user);

    R flushTimeoutRecycle();

    R remove(Long[] fileIdArray, User user);

    R move(User user, Long[] fileIdArray, Long parentId);

    R copy(User user, Long[] fileIdArray, Long parentId);

    R newFolder(User user, String name, Long parentId);

    R getDetail(Long fileId);

    R linkArchived(User user, Long parentId, String url, Integer type);

    R listSubFolder(User user, Long parentId);

    void removeByRandomName(String randomFileName);

    List<AbsolutePath> getAbsolutePath(Long userId, Long parentId);

    void removeWildFile();

}